package com.lqk.demo.jmm.exercise;

/**
 * @author lqk
 * @date 2021/12/28 19:47
 */
public class BalkingExercise {
    volatile boolean initialized = false;
    void init() {
        if (initialized) {
            synchronized (this){
                if (initialized) {
                    return;
                }
                initialized = true;
            }
        }
        doInit();
    }
    private void doInit() {
    }
}
